#ifndef _TIMEDSOLENOID_H
#define _TIMEDSOLENOID_H

#include <WPILib.h>
#include "RobotSubsystem.h"

class TimedSolenoid : public RobotSubsystem
{
public:
	TimedSolenoid(uint32_t port);
	virtual ~TimedSolenoid();
	
	void Trigger( bool on);
	
	//Subsystem Functions
	void DoTriggering(void);
	virtual void DoAutonomousPeriodic(void);
	virtual void DoTeleopPeriodic(void);
	
private:
	enum State { kNotTriggering, kTriggeringOn,kTriggeringOff};
	Timer *m_timer;
	Solenoid *m_solenoid;
	State m_state;
	
	static const double c_timeout = 0.25;
};
#endif

